home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 September
/
EnigmA AMIGA RUN 30 (1998)(G.R. Edizioni)(IT)[!][issue 1998-09].iso
/
earkit
/
ftp
/
gui-ftp
/
rexx
/
windowsnt.filter
< prev
Wrap
Text File
|
1998-07-09
|
2KB
|
80 lines
/* REXX */
/*
** An ARexx script to convert Windows NT listings to a format that Gui-FTP
** can understand.
**
** The input file has the format:
**
** <DATE> <TIME> <TYPE> <SIZE> <NAME>
**
** <DATE> is MM-DD-YY
** <TIME> is HH:MMxx (xx = AM or PM as appropriate)
** <TYPE> is '<DIR>' for a directory, blank otherwise
** <SIZE> is the size of the file in bytes, blank for a directory
** <NAME> is the files name.
**
** for example,
**
** 10-26-94 07:37AM <DIR> Earth
** 10-26-94 10:24PM 3274 IAMS.TXT
**
** The output file has the format usually produced by the Unix 'ls' command
** 'ls -lgA', i.e.
**
** <flags> <dirs> <user> <group> <size> <DD MMM YYYY> <name>
**
** drwxrwxrwx 2 kev users 1024 01 Jan 1994 ADir
** -rw-r--r-- 1 kev users 16524 5 Aug 01:23 ThisIsAFile
**
** The script MUST read from STDIN and write to STDOUT. It will be passed
** each line of data exactly as received by Gui-FTP. The file must write
** one line of data for each file in the input stream, i.e. this script is
** responsible for handling multi-data lines and merging them into a single
** line.
*/
MONTHS.1 = "Jan"
MONTHS.2 = "Feb"
MONTHS.3 = "Mar"
MONTHS.4 = "Apr"
MONTHS.5 = "May"
MONTHS.6 = "Jun"
MONTHS.7 = "Jul"
MONTHS.8 = "Aug"
MONTHS.9 = "Sep"
MONTHS.10 = "Oct"
MONTHS.11 = "Nov"
MONTHS.12 = "Dec"
do until eof( STDIN )
parse pull T$
if ~ eof( STDIN ) then do
if T$ > "" then do
SIZE = word( T$, 3 )
if SIZE > "" then do
DATE = word( T$, 1 )
MM = substr( DATE, 1, 2 )
DD = substr( DATE, 4, 2 )
YY = substr( DATE, 7, 2 )
CC = "19"
if YY > 95 then do
CC = "20"
end
DATE = " " || MONTHS.MM || " " || DD || " " || CC || YY || " "
if SIZE = "<DIR>" then do
DIR = "d"
SIZE = 0
end
else do
DIR = "-"
end
OUTLINE = DIR || "rwxrwxrwx 1 nobody nobody " || right( SIZE, 8 ) || DATE || WORD( T$, 4 )
say OUTLINE
end
end
end
end
exit 0